﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace CrusadeGmTool.Models
{
    [Serializable()]
    public class LoginInfo : ISerializable
    {
        public string Servername { get; set; }
        public string Username { get; set; }
        public string Password { get; set; }
        public string HostAdress { get; set; }
        public int Port { get; set; }

        public LoginInfo() { }

        public LoginInfo(SerializationInfo info, StreamingContext context)
        {
            Servername = (string)(info.GetValue("Servername", typeof(string)));
            Username = (string)(info.GetValue("Username", typeof(string)));
            Password = (string)(info.GetValue("Password", typeof(string)));
            HostAdress = (string)(info.GetValue("HostAdress", typeof(string)));
            Port = (int)(info.GetValue("Port", typeof(int)));
        }

        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("Servername", this.Servername);
            info.AddValue("Username", this.Username);
            info.AddValue("Password", this.Password);
            info.AddValue("HostAdress", this.HostAdress);
            info.AddValue("Port", this.Port);
        }
    }
}
